fix(sdks): HL fromMarketId accepts outcome tokens; add fetchEventsPaginated - #1252
Merged
realfishsam merged 1 commit intoJun 21, 2026
Merged
Conversation
…inated
Hyperliquid:
- fromMarketId() now accepts either canonical hl-outcome-{N} OR a raw
encoded asset token (the numeric outcomeId returned by
UnifiedMarket.outcomes[].outcomeId). The 'outcomeId' parameter on
fetchOrderBook / fetchOHLCV / fetchTrades was rejecting real outcome
tokens because it only matched the hl-outcome-* form. Now callers can
pass either, matching the param's documented name.
SDKs:
- BaseExchange.fetchEventsPaginated existed but neither the Python nor
TS client exposed it. Added fetch_events_paginated /
fetchEventsPaginated wrappers mirroring the existing
fetchMarketsPaginated pattern.
Verified locally against npm run server, both SDKs:
fetchEventsPaginated OK
fetchOrderBook(outcomeTok) OK
fetchOHLCV(outcomeTok) OK
fetchTrades(outcomeTok) OK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes uncovered by the HL SDK matrix audit:
HL
fetchOrderBook/fetchOHLCV/fetchTradesrejected real outcome tokens. The param is namedoutcomeIdbut the handler only accepted the canonicalhl-outcome-{N}form. Passing an actual outcome token (e.g.100002000, as returned byUnifiedMarket.outcomes[].outcomeId) threwInvalid Hyperliquid market ID: 100002000.fromMarketId()now accepts either form viadecodeAssetId.fetchEventsPaginatedwas missing from both SDKs.BaseExchange.fetchEventsPaginatedexisted but neitherclient.pynorclient.tsexposed a wrapper. Addedfetch_events_paginated/fetchEventsPaginatedmirroring the existingfetchMarketsPaginatedpattern.Verified locally (Python + TS) against
npm run serverNot in scope (reminder, untested without creds)
fetchBalance, fetchPositions, fetchOpenOrders, fetchMyTrades, fetchClosedOrders, fetchAllOrders, fetchOrder, cancelOrder, submitOrder, createOrder.